/**
 * Project: complex.hessian
 * 
 * File Created at 2011-9-11
 * $Id$
 * 
 * Copyright 2008 Alibaba.com Croporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.complex.hessian;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

import com.caucho.hessian.io.Hessian2Input;
import com.caucho.hessian.io.Hessian2Output;

/**
 * TODO Comment of Hello
 * 
 * @author ymkyve
 * 
 */
public class Hello implements IHello {

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.complex.hessian.IHello#hello()
	 */
	@Override
	public String hello(String name) {
		System.out.println(name);
		return name;
	}

	public static void main(String[] args) {
		try {
			ByteArrayOutputStream out = new ByteArrayOutputStream();
			Hessian2Output houtput = new Hessian2Output(out);
			houtput.writeObject("test");
			houtput.flush();
			ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
			Hessian2Input hinput = new Hessian2Input(in);
			System.out.println(hinput.readObject());
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
